package qs.openxt.libs.qrcode;

import android.content.Context;

public class QrcodeLoading {
	protected OnActionListener listener = null;

	private QrcodeLoadingTask task = null;

	public QrcodeLoading(Context context) {
	}

	public QrcodeLoading(Context context, OnActionListener l) {
		this.listener = l;
	}

	public void setOnActionListener(OnActionListener l) {
		this.listener = l;
	}

	public void doRequest() {
		task = new QrcodeLoadingTask(this);
		task.execute("");
	}

	public void onSuccess() {

		if (listener != null) {
			listener.onActionCompleted();
		}
	}

	public abstract interface OnActionListener {
		public abstract void onActionCompleted();
	}
}
